NoSQL operator: nltable

Number lines in a table, optionally based on specified column values.

Usage:
    nltable [options] [column ...]

Options:
    --input (-i) 'file'
      Read input from 'file' instead of STDIN.

    --output (-o) 'file'
      Write output to 'file' instead of STDOUT.

    --help (-h)
      Display this help text.

    --no-header (-N)
      Remove header from output.

    --last (-l)
      If the input table contains duplicated column names
      pick the last occurrence of each. The default is to
      pick the first one. This is sometimes useful after
      the 'jointable' operator.

    --key (-K) 'name'
      Use 'name' as opposed to the default ``_id'' as the
      resulting key column name.

    --delimiter (-d) 'string'
      Use 'string' as opposed to NULL as the delimiter between
      the values that are being concatenated on output to form
      the output record key.

    --encode (-e)
      Encode each character of the resulting key value into its
      hexadecimal representation (i.e. the "A" character becomes "41",
      "M" becomes "4d", and so on). Unknown characters ar replaced by
      an undescore "_". This mechanism is useful to obtain "safe"
      tokens from the resulting key values, i.e. tokens than can be
      used in file-names or in other places where not all characters
      are allowed, without loosing information on the key content.

    --start (-s) 'num'
      Where applicable, start '_id' numbering from 'num'.
      By default, numbering starts from '0'. This option
      applies only if no 'column' arguments are specified.

Notes:

Many-to-many relations usually lack a primary key field, as the
latter is implicitly defined by the concatenation of the keys from
the two sides of the relation, i.e. by the two foreign keys that
make up the relation itself. Update operations done with the NoSQL
'update' operator, however, require that each record be uniquely
identifiable on a key attribute. To avoid using deprecated generic
"_id" fields for such a purpose, 'nltable' provides a way to build a
meaningful primary key field containing the two foreign keys
concatenated together. The resulting key column is placed in the
first (leftmost) position of the resulting table and, provided
that the input table is sorted on both the involved fields, the
resulting table will already be sorted on the computed key.
For the sake of flexibility, the resulting key will be the
concatenation of as many columns as are listed on the command-line.
If no valid columns are specified, then the table will be
assigned a (deprecated) generic "_id" field value in the form
of the record number in table.

No checks are done to ensure that the values in the fields
that are being concatenated will result in a valid table primary
key, except that if one of them is NULL then a warning message is
printed. The program purposely does not try to "normalize" the
values involved, i.e. by stripping spaces, converting characters
into lower-case and things like that, to avoid the risk of building
duplicated keys out of otherwise unique field combinations.
Back